home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / CloseLibs.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.3 KB  |  67 lines

  1. //#define __USE_SYSBASE
  2.  
  3. //#include <extras/libs.h>
  4. #include <clib/extras_protos.h>
  5.  
  6. //#define __USE_SYSBASE
  7. #include <proto/exec.h>
  8.  
  9. struct Library *MyExecBase;
  10.  
  11. /****** extras.lib/ex_CloseLibs ******************************************
  12. *
  13. *   NAME
  14. *       ex_CloseLibs -- close multiple libraries.
  15. *
  16. *   SYNOPSIS
  17. *       ex_CloseLibs(Libs)
  18. *
  19. *       void ex_CloseLibs(struct Libs *);
  20. *
  21. *   FUNCTION
  22. *       Close multiple libraries using the same array of
  23. *       struct Libs as used in OpenLibs.
  24. *
  25. *   INPUTS
  26. *       Libs - A pointer to an array of struct Libs.
  27. *
  28. *   RESULT
  29. *       none.
  30. *
  31. *   NOTES
  32. *       exec.library must already be opened.(usually done by the 
  33. *       compiler's startup code)
  34. *
  35. *       revision 1.1
  36. *         corrected autodoc.
  37. *         now openes ExecBase on it's own.
  38. *       revision 1.2
  39. *         renamed to ex_CloseLib due to conflict with reaction.lib
  40. *
  41. *   BUGS
  42. *
  43. *   SEE ALSO
  44. *       ex_OpenLibs()
  45. ******************************************************************************
  46. *
  47. */
  48.  
  49.  
  50. void ex_CloseLibs(struct Libs *Libs)
  51. {
  52.   struct ExecBase *SysBase;
  53.   struct Libs *l;
  54.   
  55.   l=Libs;
  56.   
  57.   SysBase=(struct ExecBase *)(*((ULONG *)4));
  58.   
  59.   while(l->LibName)
  60.   {
  61.     if(l->LibBase)
  62.       if(*l->LibBase)
  63.         CloseLibrary(*l->LibBase);
  64.     l++;
  65.   }   
  66. }
  67.